import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import toast from '@/components/common/toast'
import FastClick from 'fastclick'
import VueLazyLoad from "vue-lazyload";

Vue.config.productionTip = false

// 安装自定义插件toast
Vue.use(toast)

// 自定义浏览器标题 有bug
Vue.directive('title', {
  inserted(el, binding) {
    document.title = el.dataset.title
  }
})

// 给 $bus 赋予一个实例接受发送得事件
Vue.prototype.$bus = new Vue()

// 解决移动端浏览器300ms点击延迟
FastClick.attach(document.body)

// 图片懒加载
Vue.use(VueLazyLoad, {
  loading: require('./assets/img/common/placeholder.png')
})

new Vue({
  router,
  render: h => h(App),
  store
}).$mount('#app')
